package com.neuedu.advance.abstclass;

/**
 * @author 金山
 * 项目：javase
 * site: https://blog.fulfill.com.cn
 * 描述
 * @data 2024/10/1811:22
 *
 *  抽象类不能被直接new
 *
 */
public abstract class Animal {
     private String name;
     private double weight;

    public Animal() {
    }

    public Animal(String name, double weight) {
        this.name = name;
        this.weight = weight;
    }

    public void play(){
        System.out.println(name+ " 在演出......");
    }



    //子类 必须重写
    public abstract void eat();


    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public double getWeight() {
        return weight;
    }

    public void setWeight(double weight) {
        this.weight = weight;
    }
}
